SIP310 Implement H2O mass-balance checking#343
Open
ANAMASGARD wants to merge 2 commits into
Open
Conversation
Mirror the PR PecanProject#248 balance framework for H2O: track soilWater and snow, compare timestep change against external water fluxes, and log warnings when conservation fails. Expose bcdeltaC, bcdeltaN, and bcdeltaW in sipnet.out; extend testBalance and smoke baselines accordingly. Closes PecanProject#310
Regenerate sipnet.out and russell_1/events.out after make clean so CI smoke tests agree with freshly built binaries. Removes stale reference values and accidental events.out drift from the initial baseline update.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FIXES #310
Summary
Implements water mass-balance checking following the same framework as PR #248 (carbon/nitrogen):
soilWater+snoweach timestep (pre-update → post-update → post-clamp)deltaWaterexceeds tolerance (EPS)bcdeltaC,bcdeltaN, andbcdeltaWcolumns tosipnet.outtestBalancewithcheckWater()and updates smoke baselinesDesign notes
ctx.leafWateronly capsimmedEvap; excess interception goes to soil vianetRainsnowMeltexcluded — internal transfer (snow → soil), not external I/OeventEvapon both sides — gross irrigation enters the system (input) and the evaporated portion leaves immediately (output); net soil addition iseventSoilWaterTest plan
make testbuild— builds successfullybcdeltaW = 0.00000in smoke output; zero"Water balance check failed"warningscheckWater()passes in alltestBalancesubtestsmake smoke— passes after baseline updatetestBalanceoverall still fails due to a pre-existing carbon balance delta (deltaC ≈ 610 g C/m²), unrelated to this PR. Water checks pass.